\(\int \sqrt {-1-\tan ^2(x)} \, dx\) [291]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [C] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 16 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=-\arctan \left (\frac {\tan (x)}{\sqrt {-\sec ^2(x)}}\right ) \]

[Out]

-arctan(tan(x)/(-sec(x)^2)^(1/2))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3738, 4207, 223, 209} \[ \int \sqrt {-1-\tan ^2(x)} \, dx=-\arctan \left (\frac {\tan (x)}{\sqrt {-\sec ^2(x)}}\right ) \]

[In]

Int[Sqrt[-1 - Tan[x]^2],x]

[Out]

-ArcTan[Tan[x]/Sqrt[-Sec[x]^2]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4207

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[b*(ff/
f), Subst[Int[(b + b*ff^2*x^2)^(p - 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {-\sec ^2(x)} \, dx \\ & = -\text {Subst}\left (\int \frac {1}{\sqrt {-1-x^2}} \, dx,x,\tan (x)\right ) \\ & = -\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\tan (x)}{\sqrt {-\sec ^2(x)}}\right ) \\ & = -\arctan \left (\frac {\tan (x)}{\sqrt {-\sec ^2(x)}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=\text {arctanh}(\sin (x)) \cos (x) \sqrt {-\sec ^2(x)} \]

[In]

Integrate[Sqrt[-1 - Tan[x]^2],x]

[Out]

ArcTanh[Sin[x]]*Cos[x]*Sqrt[-Sec[x]^2]

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06

method result size
derivativedivides \(-\arctan \left (\frac {\tan \left (x \right )}{\sqrt {-1-\tan \left (x \right )^{2}}}\right )\) \(17\)
default \(-\arctan \left (\frac {\tan \left (x \right )}{\sqrt {-1-\tan \left (x \right )^{2}}}\right )\) \(17\)
risch \(-2 \sqrt {-\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )+2 \sqrt {-\frac {{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )\) \(64\)

[In]

int((-1-tan(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-arctan(tan(x)/(-1-tan(x)^2)^(1/2))

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.25 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.19 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=i \, \log \left (e^{\left (i \, x\right )} + i\right ) - i \, \log \left (e^{\left (i \, x\right )} - i\right ) \]

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

I*log(e^(I*x) + I) - I*log(e^(I*x) - I)

Sympy [F]

\[ \int \sqrt {-1-\tan ^2(x)} \, dx=\int \sqrt {- \tan ^{2}{\left (x \right )} - 1}\, dx \]

[In]

integrate((-1-tan(x)**2)**(1/2),x)

[Out]

Integral(sqrt(-tan(x)**2 - 1), x)

Maxima [A] (verification not implemented)

none

Time = 0.41 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=\arctan \left (\cos \left (x\right ), \sin \left (x\right ) + 1\right ) + \arctan \left (\cos \left (x\right ), -\sin \left (x\right ) + 1\right ) \]

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

arctan2(cos(x), sin(x) + 1) + arctan2(cos(x), -sin(x) + 1)

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.26 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=-i \, \log \left (\sqrt {\tan \left (x\right )^{2} + 1} - \tan \left (x\right )\right ) \]

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

-I*log(sqrt(tan(x)^2 + 1) - tan(x))

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \sqrt {-1-\tan ^2(x)} \, dx=-\mathrm {atan}\left (\frac {\mathrm {tan}\left (x\right )}{\sqrt {-{\mathrm {tan}\left (x\right )}^2-1}}\right ) \]

[In]

int((- tan(x)^2 - 1)^(1/2),x)

[Out]

-atan(tan(x)/(- tan(x)^2 - 1)^(1/2))